#include "cpu/exec/template-start.h"

make_helper(concat(cwtl_cltd_, SUFFIX)) {
	DATA_TYPE_S temp = REG(0);
	if (temp < 0) {
		REG(2) = -1;
	}
	else {
		REG(2) = 0;
	}

	if (DATA_BYTE == 4) {
		print_asm("cltd");
	}
	else { /* DATA_BYTE == 2 */
		print_asm("cwtl");
	}
	return 1;
}

#include "cpu/exec/template-end.h"
